﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SQLhomework
{
    public partial class MainFrom : Form
    {
        public MainFrom()
        {
            InitializeComponent();
        }

 
        private void button1_Click(object sender, EventArgs e)
        {
            //this.Controls.Remove(panel1);
            UserForm userControl1 = new UserForm();
            FormChange(panel1, userControl1);
            //this.Controls.Add(userControl1);
        }

        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if( e.KeyCode == Keys.Enter)
            {
                textBox2.Focus();
                //this.Controls.Remove(panel1);
            }
        }


        private void textBox2_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                button1_1.Focus();
                //this.Controls.Remove(panel1);
            }
        }
        //切换窗口
        private void FormChange(object form1,object form2)
        {
            this.Controls.Remove((Control)form1);
            this.Controls.Add((Control)form2);

        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }
    }

        
}
